package L1;

import java.io.IOException;
import java.util.Scanner;

public class _093 {
    /**
     * 猜帽子游戏
     */
    public static void main(String[] args) throws IOException {
        Scanner sca = new Scanner(System.in);
        int N  = sca.nextInt();
        int[] mao = new int[N];
        int[] cai = new int[N];
        for(int i=0;i<N;i++){
            mao[i] = sca.nextInt();
        }
        int K = sca.nextInt();
        for (int i=0;i<K;i++){
            boolean flag = true;
            int zero =0;
            for (int j=0;j<N;j++){
                cai[j]=sca.nextInt();
                if (cai[j]==0){
                    zero++;
                }else if (cai[j]!=mao[j]){
                    flag=false;
                }
            }
            if (zero==N){
                flag=false;
            }
            if (flag){
                System.out.println("Da Jiang!!!");
            }else {
                System.out.println("Ai Ya");
            }
        }
    }
}
